package com.example.administrator.yuejian2.model;


import com.example.administrator.yuejian2.bean.Register;
import com.example.administrator.yuejian2.service.YuejianService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

import static com.example.administrator.yuejian2.finalclass.Yuejian.URL;

/**
 * Created by 木子也 on 2017/9/26.
 */

public class LoginModel {
    private Retrofit retrofit;

    public LoginModel() {
        retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl(URL)
                .build();

    }





    public Call<Register> userReg(String phone, String name, String pwd) {  //注册
        YuejianService service = retrofit.create(YuejianService.class);
        Retrofit retrofit = new Retrofit.Builder()
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl(URL)
                .build();
        return service.register(phone, name, pwd);
    }




}

